﻿using Shell.DomainDot;
using Shell.PocoDot.Configurations;
using Framework.Poco;
using Shell.PocoDot;

namespace MyMvcApplication
{
    /// <summary>
    /// 实体注册
    /// </summary>
    internal static class EntityRegister
    {
        /// <summary>
        /// 注册
        /// </summary>
        public static void Register()
        {
            ObjectSeeker.Seeker = new MockContainer();
            var provider = new ProviderConfiguration("conn");
            provider.CreateIfNotExists = true;
            provider.Register<Agency>();
            provider.Register<Contact>();
            provider.Register<District>();
            provider.Register<AgencyGroup>();
            provider.Register<Article>();
            provider.Register<BinaryFile>();
            provider.Register<User>();
            provider.Register<Category>();
            provider.Register<Video>();
            provider.Register<AgencyServiceProjects>();
            provider.Register<PictureCategory>();
            provider.Register<Gift>();
            provider.Register<Hotel>();
            provider.Register<HotelHall>();
            provider.Register<ServiceCost>();
            provider.Register<ConsumptionClass>();
            provider.Register<FeaturedWedding>();
            provider.Register<ChurchWedding>();
            provider.Register<HotelHallNextYear>();
            provider.Register<Advertising>();
            provider.Register<FriendlyLink>();
            provider.Register<BookingTime>();
            provider.Register<Discount>();
            provider.Register<MessageBoard>();
            provider.Register<Reservation>();
            provider.Register<Agency, Reservation>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Agency, Discount>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<Agency, MessageBoard>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<HotelHall, BookingTime>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<AgencyGroup, Advertising>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Category, Advertising>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Advertising, BinaryFile>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<AgencyGroup, FriendlyLink>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Category, FriendlyLink>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Agency, Hotel>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<Hotel, HotelHall>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Hotel, FeaturedWedding>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<Hotel, ChurchWedding>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<HotelHall, HotelHallNextYear>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<HotelHall, ServiceCost>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<HotelHall, ConsumptionClass>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<Agency, AgencyGroup>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<User, Contact>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<Agency, BinaryFile>(Relationships.WithOne, Relationships.WithOne);
            provider.Register<Agency, District>(Relationships.WithOne, Relationships.WithMany);
            provider.Register<Agency, Contact>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Agency, Video>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Agency, PictureCategory>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Agency, Article>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<Category, Article>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<AgencyGroup, AgencyServiceProjects>(Relationships.WithMany, Relationships.WithOne);
            provider.Register<PictureCategory, BinaryFile>(Relationships.WithMany, Relationships.WithOne);
        }
    }
}